package com.cskaoyan._02feature;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/15 10:57
 **/
/*
字符串比较
 */
public class Demo5 {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        System.out.println(s1 == s2);// false
        System.out.println(s1.equals(s2));//true

        String s3 = new String("hello");
        String s4 = "hello";
        System.out.println(s3 == s4);// false
        System.out.println(s3.equals(s4));// ture

        String s5 = "hello";
        String s6 = "hello";
        System.out.println(s5 == s6);// true
        System.out.println(s5.equals(s6));// true
    }
}
